/**
 * JAVACC DEMO 1.0
 * @copy right dwusoft company All rights reserved. 
 * @Package com.apache.bid.service.cacheplugins  
 */
package com.apache.bid.service.cacheplugins;

import java.util.List;

import com.apache.api.manager.PluginConnector;
import com.apache.api.vo.ParamsVo;
import com.apache.api.vo.ResultEntity;
import com.apache.bid.entity.BidInfoBaojia;
import com.apache.bid.manager.BidInfoBaojiaManager;
import com.apache.cache.util.Validator;

/**
 * description:  获取报价列表
 * @author Hou Dayu 创建时间：2016-4-6  
 * 
 */
public class FindInfoBaojiaPlguinImpl implements PluginConnector {

	private BidInfoBaojiaManager bidInfoBaojiaManager;

	/**
	 * TODO 简单描述该方法的实现功能（可选）.  
	 * @see com.zbxsoft.api.manager.PluginConnector#execute(com.zbxsoft.api.vo.ParamsVo)  
	 */
	public Object execute(ParamsVo param) throws Exception {
		String itemId = String.valueOf(param.getParams("itemId"));
		ResultEntity entity = new ResultEntity();
		if (Validator.isNull(itemId)) {
			entity.setResult("false");
			entity.setMessage("执行方法缺少必要参数");
			return entity;
		}
		BidInfoBaojia baojia = new BidInfoBaojia();
		param.setMethodKey("");
		baojia.setItemId(itemId);
		param.setObj(baojia);
		List<BidInfoBaojia> list = bidInfoBaojiaManager.getList(param);
		entity.setResult("true");
		entity.setMessage("查询成功");
		entity.setEntity(list);
		return entity;
	}

	public void setBidInfoBaojiaManager(BidInfoBaojiaManager bidInfoBaojiaManager) {
		this.bidInfoBaojiaManager = bidInfoBaojiaManager;
	}

}
